home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 18 / CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso / CUCD / Programming / AmigaE / Src / OOmodules / oodoc / templates / new_object.e < prev   
Encoding:
Text File  |  1996-10-31  |  3.3 KB  |  257 lines

  1. /*
  2.  
  3. Object template.
  4.  
  5. Replace 'new_object' with your object name and 'parent_object' with the
  6. object name you inherit from.
  7.  
  8. You definitely have to modify select(), init() and end(). The methods
  9. open( and close() are just for your convenience, you may delete them if you
  10. don't need them.
  11.  
  12. First template version
  13.  
  14. October 31 1996 Gregor Goldbach
  15.  
  16. */
  17.  
  18. OPT MODULE
  19.  
  20. MODULE  'oomodules/'
  21.  
  22. EXPORT OBJECT new_object OF parent_object
  23. /****** library/new_object ******************************
  24.  
  25.     NAME
  26.         new_object() of parent_object --
  27.  
  28.     SYNOPSIS
  29.         parent_object.new_object()
  30.  
  31.     PURPOSE
  32.         Describe what the object's purpose is.
  33.  
  34.     ATTRIBUTES
  35.         List the attributes with their type and a description. If a default
  36.         value is set in init() you should write this down.
  37.  
  38.         attribute:type -- description
  39.  
  40.     SEE ALSO
  41.         parent_object
  42.  
  43. ********/
  44. ENDOBJECT
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. EXPORT PROC init() OF new_object
  52. /****** new_object/init ******************************
  53.  
  54.     NAME
  55.         init() of new_object -- Initialization of the new new_object object
  56.             instance.
  57.  
  58.     SYNOPSIS
  59.         new_object.init()
  60.  
  61.     FUNCTION
  62.         Sets attribute foobar to default value xxx.
  63.  
  64.     RESULT
  65.  
  66.     EXAMPLE
  67.  
  68.     CREATION
  69.  
  70.     HISTORY
  71.  
  72.     NOTES
  73.         Calls parental object's init() method.
  74.  
  75.     SEE ALSO
  76.         new_object
  77.  
  78. ********/
  79.  
  80.  /*
  81.   * Call parental object's init() method if needed.
  82.   */
  83.  
  84.   SUPER self.init()
  85.  
  86. ENDPROC
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93. PROC open() OF new_object
  94. /****** new_object/open ******************************
  95.  
  96.     NAME
  97.         open() of new_object --
  98.  
  99.     SYNOPSIS
  100.         new_object.open()
  101.  
  102.     FUNCTION
  103.  
  104.     RESULT
  105.  
  106.     EXAMPLE
  107.  
  108.     CREATION
  109.  
  110.     HISTORY
  111.  
  112.     NOTES
  113.  
  114.     SEE ALSO
  115.         new_object
  116.  
  117. ********/
  118.  
  119. ENDPROC
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126. PROC close() OF new_object
  127. /****** new_object/close ******************************
  128.  
  129.     NAME
  130.         close() of new_object --
  131.  
  132.     SYNOPSIS
  133.         new_object.close()
  134.  
  135.     FUNCTION
  136.  
  137.     RESULT
  138.  
  139.     EXAMPLE
  140.  
  141.     CREATION
  142.  
  143.     HISTORY
  144.  
  145.     NOTES
  146.  
  147.     SEE ALSO
  148.         new_object
  149.  
  150. ********/
  151.  
  152. ENDPROC
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159. PROC select(optionlist, index) OF new_object
  160. /****** new_object/close ******************************
  161.  
  162.     NAME
  163.         select() of new_object -- Selection of action upon initialization.
  164.  
  165.     SYNOPSIS
  166.         new_object.select()
  167.  
  168.     FUNCTION
  169.         The following tags are recognized:
  170.             "tag" -- description
  171.  
  172.     RESULT
  173.  
  174.     EXAMPLE
  175.  
  176.     CREATION
  177.  
  178.     HISTORY
  179.  
  180.     NOTES
  181.         Calls parental object's select() method.
  182.  
  183.     SEE ALSO
  184.         new_object
  185.  
  186. ********/
  187.  
  188. DEF item
  189.  
  190.   item:=ListItem(optionlist,index)
  191.  
  192.   SELECT item
  193.  
  194.     CASE -> "open"
  195.  
  196.       INC index
  197.       self.your method(ListItem(optionlist,index))
  198.  
  199.     DEFAULT
  200.  
  201.      /*
  202.       * Call parental object's select() method if we don't know the tag.
  203.       */
  204.  
  205.       index := SUPER self.select(optionlist, index)
  206.  
  207.    ENDSELECT
  208.  
  209. ENDPROC index
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216. PROC end() OF new_object
  217. /****** new_object/end ******************************
  218.  
  219.     NAME
  220.         end() of new_object -- Global destructor for object instance.
  221.  
  222.     SYNOPSIS
  223.         new_object.end()
  224.  
  225.     FUNCTION
  226.  
  227.     RESULT
  228.  
  229.     EXAMPLE
  230.  
  231.     CREATION
  232.  
  233.     HISTORY
  234.  
  235.     NOTES
  236.         Calls parental object's end() method.
  237.  
  238.     SEE ALSO
  239.         new_object
  240.  
  241. ********/
  242.  
  243.  /*
  244.   * Call parental object's end() method if needed.
  245.   */
  246.  
  247.   SUPER self.end()
  248.  
  249. ENDPROC
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256. PROC name() OF new_object IS -> insert name constant here
  257.